home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #12 / Amiga Plus CD - 2002 - No. 12.iso / Tools / Freeware / Swf_Player / Lib / displaylist.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-11-17  |  2.8 KB  |  81 lines

  1. /////////////////////////////////////////////////////////////
  2. // Flash Plugin and Player
  3. // Copyright (C) 1998 Olivier Debon
  4. // 
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU General Public License
  7. // as published by the Free Software Foundation; either version 2
  8. // of the License, or (at your option) any later version.
  9. // 
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. // 
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. // 
  19. ///////////////////////////////////////////////////////////////
  20. #ifndef _DISPLAYLIST_H_
  21. #define _DISPLAYLIST_H_
  22.  
  23. class Character;
  24. class Program;
  25.  
  26. struct DisplayList;
  27.  
  28. // Display List management
  29. struct DisplayListEntry {
  30.     Character        *character;
  31.     long         depth;
  32.     Matrix        *matrix;
  33.     Cxform        *cxform;
  34.     char        *instanceName;
  35.     
  36.     /* button state */
  37.     ButtonState         renderState;
  38.     ButtonState         oldState;
  39.     Character        *buttonCharacter;
  40.     Matrix         buttonMatrix;
  41.     Matrix renderMatrix; /* last render matrix */
  42.  
  43.     DisplayListEntry    *next;
  44.  
  45.     DisplayList        *owner;    // Parent
  46. };
  47.  
  48. struct DisplayList {
  49.     DisplayListEntry    *list;
  50.     FlashMovie          *movie;
  51.     Rect         bbox;        // Delta clipping region
  52.     int             isSprite;
  53. public:
  54.     DisplayList(FlashMovie *movie);
  55.     ~DisplayList();
  56.     DisplayListEntry    *getList();
  57.     void         clearList();
  58.     void         placeObject(GraphicDevice *gd,Character *character, long depth, Matrix *matrix = 0, Cxform *cxform = 0, char *name = 0);
  59.     Character        *removeObject(GraphicDevice *gd, Character *character, long depth);
  60.  
  61.     int             render(GraphicDevice *gd, Matrix *m = 0, Cxform *cxform = 0);
  62.     void         updateBoundingBox(DisplayListEntry *);
  63.     void         updateButtons (FlashMovie *);
  64.     void          getBoundary(Rect *bb);    // Returns boundary of current displayed objects
  65.     int             updateSprites();    // Update sprites in the display list
  66. };
  67.  
  68. typedef void (*DisplayListFunc)(DisplayListEntry *e, void *opaque);
  69.  
  70. void         updateButtons(FlashMovie *m);
  71. int         computeActions(FlashMovie *m, Program **prog, ActionRecord **ar);
  72. void         renderFocus(FlashMovie *movie);
  73.  
  74. typedef int (*ExploreButtonFunc)(void *opaque, Program *prg, DisplayListEntry *e);
  75. int         exploreButtons(FlashMovie *movie, void *opaque, ExploreButtonFunc func);
  76. void         updateBoundingBox(DisplayListEntry *e);
  77. void         transformBoundingBox(Rect *bb, Matrix *matrix, Rect *boundary, int reset);
  78. void         updateButtonState(DisplayListEntry *e, ButtonState state);
  79.  
  80. #endif /* _DISPLAYLIST_H_ */
  81.